#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
using namespace std;
class Solution 
{
public:
    int removeDuplicates(vector<int>& nums)
    {
        int count = 1;
        //sort(nums.begin(),nums.end());
        for (int i = 0;i < nums.size() - 1;i++)
        {
            if (nums[i] != nums[i + 1])
            {
                nums[count] = nums[i + 1];
                count++;
            }
        }
        return count;
    }
};